﻿package net.wangit.app.user;

import net.wangit.Row;
import net.wangit.User;
import net.wangit.context.ActionContext;
import net.wangit.support.ElementWriter;
import net.wangit.view.element.ElementComponent;

public class UserElementWriter implements ElementWriter {

  public void write(ActionContext ac, StringBuffer html, ElementComponent ec,
      Row row) {
    User user = ac.getVisitor().getUser();
    String userName = user.get("username");
    html.append("".equals(userName) ? user.getId() : userName);
  }

}
